home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DBVGAL17.ARJ / SRC_ASM.ARJ / VSQ.ASM < prev    next >
Assembly Source File  |  1992-01-25  |  3KB  |  110 lines

  1.         name    vsq     ; VGA Sequencer routines
  2.         ;
  3.         ;  void Select_Wplane(int planes);
  4.         ;       planes = bit mask 0=plane 0 write enable, 1=plane 1, etc.
  5.         ;
  6.         ;  void SQset_reg(int reg, int value);
  7.         ;  int  SQread_reg(int reg);
  8.         ;  void SQset_regm(int reg, int value, int bitmask);
  9.         ;  void Vdisable_refresh(void);
  10.         ;  void Venable_refresh(void);
  11.         ;
  12.  
  13. SEQUENCER_PORT          EQU     03C4h   ;Sequencer
  14. PLANE_ENABLE_REG        EQU     2       ;Write plane enable register
  15.  
  16. ARG1    equ     [bp+06]
  17. ARG2    equ     [bp+08]
  18. REGNO   equ     [bp+06]
  19. VALUE   equ     [bp+08]
  20. BMASK   equ     [bp+0ah]
  21.  
  22. SQ_TEXT       segment byte public 'CODE'
  23.         public  _Select_WPlane
  24.         assume  cs:SQ_TEXT
  25. _Select_WPlane   proc    far
  26.         push    bp
  27.         mov     bp,sp
  28.         mov     ah,ARG1
  29.         mov     dx,SEQUENCER_PORT
  30.         mov     al,PLANE_ENABLE_REG
  31.         out     dx,ax
  32.         pop     bp
  33.         ret
  34. _Select_WPlane   endp
  35.         public  _SQread_reg
  36. _SQread_reg   proc    far
  37.         push    bp
  38.         mov     bp,sp
  39.         mov     al,ARG1
  40.         mov     dx,SEQUENCER_PORT
  41.         out     dx,al
  42.         inc     dx
  43.         in      al,dx
  44.         xor     ah,ah
  45.         pop     bp
  46.         ret
  47. _SQread_reg   endp
  48.         public  _SQset_reg
  49. _SQset_reg   proc    far
  50.         push    bp
  51.         mov     bp,sp
  52.         mov     al,ARG1
  53.         mov     ah,ARG2
  54.         mov     dx,SEQUENCER_PORT
  55.         out     dx,ax
  56.         pop     bp
  57.         ret
  58. _SQset_reg   endp
  59.         public  _SQset_regm
  60. _SQset_regm     PROC  far
  61.         push    bp
  62.         mov     bp,sp
  63.  
  64.         mov     dl,REGNO
  65.         push    dx
  66.         call    _SQread_reg    ; returns al=reg(reg_num);
  67.         add     sp,2
  68.  
  69.         mov     bl,BMASK
  70.         not     bl        ; !mask
  71.         and     al,bl     ; al=(!mask®(reg_num));
  72.         mov     cl,al     ; save for a microsecond
  73.         mov     al,VALUE
  74.         mov     bl,BMASK
  75.         and     al,bl
  76.         or      al,cl     
  77.         push    ax
  78.         mov     al,REGNO
  79.         push    ax
  80.         call    _SQset_reg
  81.         add     sp,4
  82.  
  83.         xor     ax,ax
  84.         pop     bp
  85.         ret
  86. _SQset_regm     ENDP
  87.         public  _Vdisable_refresh
  88. _Vdisable_refresh   proc    far
  89.         push    bx
  90.         mov     ax,1201h
  91.         mov     bl,36h
  92.         int     10h
  93.         pop     bx
  94.         xor     ax,ax
  95.         ret
  96. _Vdisable_refresh   endp
  97.         public  _Venable_refresh
  98. _Venable_refresh   proc    far
  99.         push    bx
  100.         mov     ax,1200h
  101.         mov     bl,36h
  102.         int     10h
  103.         pop     bx
  104.         xor     ax,ax
  105. retout: ret
  106. _Venable_refresh   endp
  107. SQ_TEXT       ends
  108.         end
  109.  
  110.